# -*- coding: UTF-8 -*-

from .BaseModel import BaseModel

class WechatUserOriginalMessageModel(BaseModel):

    _database = 'wechat'
    _table = 'wechat_user_original_message'


    def __init__(self, transport_core):
        self.super = super(WechatUserOriginalMessageModel, self)
        self.super.__init__(transport_core)


    def insert(self, fromUser, toUser, msgType, content):
        insertDict = {
            'from_user' : str(fromUser).strip(),
            'to_user' : str(toUser).strip(),
            'msg_type' : int(msgType),
            'content' : str(content).strip(),
            'gmt_create' : int(self.core.loader.module('time').time())
        }

        return self.super.insert(insertDict)
